package com.example.hello;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class TextArea extends com.vaadin.ui.TextArea {

    public TextArea() {
        this(null);
    }

    public TextArea(String caption) {
        setCaption(caption);
        setStyleName("form-control");
    }

    public String getEncodedValue() {
        try {
            return URLEncoder.encode(getValue(), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return getValue();
        }
    }

}